package com.higgins.lawapp.client.settings.presenter;

import com.google.gwt.user.client.ui.Label;
import com.higgins.lawapp.client.settings.model.DataSourceModel;
import com.higgins.lawapp.client.settings.panels.FieldPanel;


public class DataSourcePresenter 	{
	private DataSourceModel dataSourceModel;
	private Label errorLabel;
	private FieldPanel dataSourcePanel;
	
	public DataSourcePresenter(DataSourceModel dataSourceModel)	{
		dataSourcePanel = new FieldPanel(dataSourceModel, this);	// Create new DataSourcePanel
		this.dataSourceModel = dataSourceModel;
	}
	public DataSourceModel getDataSourceMode()	{
		return dataSourceModel;
	}
	public void setErrorLabel(Label errorLabel)	{
		this.errorLabel = errorLabel;
	}
	public void setErrorText(String errorText)	{
		errorLabel.setText(errorText);
	}
	
	public void createDataSourceField(String fieldText)	{
//		dataSourcePanel.addDataSourceField("Data Source Name", fieldText);
	}
	public void createDataSourceURLField(String url)	{
//		dataSourcePanel.addURLField("URL", url);
	}
//	public void createButtons()	{
//		dataSourcePanel.addButtons();
//	}
	public void clearPanel()	{
		dataSourcePanel = new FieldPanel(dataSourceModel, this);
	}
	//public void createFlexTable()	{
	//	dataSourcePanel.addFlexTable();
	//}
	public FieldPanel getDataSourcePanel()	{
		 return dataSourcePanel;
	}
}
